package com.yll.service.impl;

import com.alibaba.dubbo.config.annotation.Service;
import com.yll.dao.UserDao;
import com.yll.domain.Users;
import com.yll.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;

import java.util.List;

@Service
public class UserServiceImpl implements UserService {

    @Autowired
    private UserDao userDao;

    @Override
    public boolean save(Users users) {
        return userDao.save(users);
    }

    @Override
    public boolean update(Users users) {
        return userDao.update(users);
    }

    @Override
    public boolean delete(Integer id) {
        return userDao.delete(id);
    }

    @Override
    public Users findById(Integer id) {
        return userDao.findById(id);
    }

    @Override
    public List<Users> findAll() {
        return userDao.findAll();
    }

    @Override
    public Users login(String username, String password) {
        return userDao.getUsernamAndPassword(username,password);
    }
}
